import useAppStore from "@/store/appStore";
import { Navigate } from "react-router-dom";
import { ProtectedRouteProps } from "./types";
export const ProtectedRoute = ({ children }: ProtectedRouteProps) => {
  const { user } = useAppStore();
  if (!user || !user?.logined) {
    return <Navigate to="/login" />;
  }
  return children;
};
